<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <title>用户登录</title>
    
    <link rel="stylesheet" type="text/css" href="css/style.css">
	<style>
		//.prompt{display:none;}
	</style>
</head>
<body>
	<div class="pages">
		<div class="head">
			<img class="head-logo" src="img/LOGO.png">
		</div>
		<div class="input-list">
			<div class="list-item">    
				<img class="item-icon" src="img/zhanghu.png">
				<input type="text" class="inputtxt" name="logName" placeholder="输入您的账号" autocomplete="off" />
			</div>
			<div class="list-item">
				<img class="item-icon" src="img/mima.png">
				<input type="password" class="inputtxt" name="password" placeholder="输入您的密码" autocomplete="off" />
			</div>
		</div>
		<button class="login click-login">登录</button>
		<div class="bott-txt">能工科技有限公司</div>
		<!--<div class="prompt">
			<div class="pro-icon">x</div>
			<div class="pro-txt">密码错误</div>
		</div>-->
	</div>
</body>
</html>
<script src="js/mui.min.js"></script>
<script src="js/jquery.min.js"></script>
<script src="js/project.config.js"></script>
<script> 
	mui.plusReady(function(){
		mui(".pages").on('tap','.click-login',function(){
			document.activeElement.blur();
			var logName = $("input[name=logName]").val();
			var password = $("input[name=password]").val();
			if(!logName){
				mui.toast('账号错误');
				return false;
			}
			if(!password){
				mui.toast('密码错误');
				return false;
			}
			var data = {};
			data.api = 'verify';
			data.logName = logName;
			data.password = password;
			var url = 'https://shopadmin.7ying.cc/zhgd20180606_service/index.php/home/index/request';
			mui.get(url,data,function(ref){
				if(ref.code != 0){
					_mui_dialog._toast(ref.message);
				}else{
					mui.toast('登录成功');
					plus.storage.setItem('password',data.password);
					plus.storage.setItem('logName',data.logName);
					mui.each(ref.data,function(i,v){
						plus.storage.setItem(i,v);
					});
					redirect('home.html');
				}
				return false;
			},'json'); 
		});
	});
</script>


<script>

</script>